package com.cinematicketscaning.app.controller

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.cinematicketscaning.app.R
import com.cinematicketscaning.app.adapter.MovieListAdapter
import com.cinematicketscaning.app.controller.base.BaseActivity
import com.cinematicketscaning.app.dialog.DatePickerDialog
import kotlinx.android.synthetic.main.activity_movie_list.*

class MovieListActivity : BaseActivity() {

    lateinit var adapter: MovieListAdapter
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_movie_list)
        initView()
    }

    private fun initView() {
        adapter = MovieListAdapter(this, mutableListOf(Any(), Any(), Any(), Any(), Any(), Any(), Any(), Any(), Any()))
        listview.adapter = adapter

        img_back.setOnClickListener {
            finish()
        }
        img_search.setOnClickListener {

        }
        clayout_date_picker.setOnClickListener {
            var dialog = DatePickerDialog()
            dialog.setCallback {
                tv_date.text = it
            }
            dialog.show(supportFragmentManager, "dialog")
        }
    }
}
